<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>简介函数调用</title>
</head>
<body>

    <script>
        function foo()
        {
            console.log(this);
        }

        var obj1 = {
            name:"cq",
            foo:foo
        }

        var obj2 = {
            name:"obj2"
        }

        obj1.foo();//obj1

        (obj2.foo = obj1.foo)();//window


    </script>
    
</body>
</html>